#include <bits/stdc++.h>
using namespace std;
int main() {
  char c;
  vector<char> tab;
  cin >> c;
  int total = 0;
  tab.push_back('0');
  tab.push_back('0');
  while (cin.fail() == 0) {
    total += c - '0';
    tab.push_back(c);
    cin >> c;
  }
  while (total % 4 != 0) {
    if (tab[tab.size() - 1] - '0' < '9' - '0') {
      tab[tab.size() - 1] += '1' - '0';
      total += 1;
    } else {
      tab[tab.size() - 1] = '0';
      total -= 9;
      if (tab[tab.size() - 2] - '0' < '9' - '0') {
        tab[tab.size() - 2] += '1' - '0';
        total += 1;
      } else {
        tab[tab.size() - 2] = '0';
        total -= 9;
        if (tab[tab.size() - 3] - '0' < '9' - '0') {
          tab[tab.size() - 3] += '1' - '0';
          total += 1;
        } else {
          tab[tab.size() - 3] = '0';
          tab[tab.size() - 4] += '1' - '0';
          total -= 9;
          total += 1;
        }
      }
    }
  }
  while (*tab.begin() == '0') {
    tab.erase(tab.begin());
  }
  for (int i = 0; i < tab.size(); i++) {
    cout << tab[i];
  }
}
