#include using namespace std; int main() { cin.sync_with_stdio(false); cout.tie(nullptr); int n; cin >> n; vector v(n); for (auto &item : v) { cin >> item; } for (int i = 0; i < n; i++) { int sum = 0; bool found = false; int count = 0; for (int j = i; j < n; j++) { sum += v[j]; sum %= 10; ++count; if (sum == 0) { found = true; break; } } string sep; if (i != n - 1) { sep = " "; } else { sep = ""; } if (!found) { cout << "-1" << sep; } else { cout << count << sep; } } cout << endl; }