class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.v: H = None
        self.p: E = None
        self.u: I = None
        self.r: E = None
        self.t: I = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.s: G = None
        self.q: C = None
        self.v: F = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.p: A = None
        self.t: H = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: D = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: C = None
        self.y: C = None
        self.x: A = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.txt = txt

m = A("m")
l = B("l")
g = C("g")
e = D("e")
a = E("a")
k = F("k")
f = G("f")
j = H("j")
n = I("n")
h = A("h")

m.q = a
m.p = a
m.r = a
m.s = h
m.v = j
m.w = j
m.u = n
m.t = n
l.p = g
l.q = g
l.o = g
l.u = j
l.s = f
l.v = k
l.r = a
g.q = j
g.t = j
g.s = e
g.r = e
g.p = h
e.z = a
e.p = f
a.z = f
a.x = e
a.t = g
a.u = h
k.s = a
f.w = j
f.p = g
f.y = g
f.x = h
f.s = a
j.u = n
n.v = e
n.s = a
h.q = a
h.p = a
h.r = a
h.s = m
h.v = j
h.w = j
h.u = n
h.t = n
assert g.q.u.s.u.s.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.s: A = None
        self.v: H = None
        self.p: E = None
        self.u: I = None
        self.r: E = None
        self.t: I = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.s: G = None
        self.q: C = None
        self.v: F = None
        self.o: C = None
        self.r: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.s: D = None
        self.p: A = None
        self.t: H = None
        self.r: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.p: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.z: G = None
        self.x: D = None
        self.t: C = None
        self.u: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.p: C = None
        self.y: C = None
        self.x: A = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.txt = txt

m = A("m")
l = B("l")
g = C("g")
e = D("e")
a = E("a")
k = F("k")
f = G("f")
j = H("j")
n = I("n")
h = A("h")

m.q = a
m.p = a
m.r = a
m.s = h
m.v = j
m.w = j
m.u = n
m.t = n
l.p = g
l.q = g
l.o = g
l.u = j
l.s = f
l.v = k
l.r = a
g.q = j
g.t = j
g.s = e
g.r = e
g.p = h
e.z = a
e.p = f
a.z = f
a.x = e
a.t = g
a.u = h
k.s = a
f.w = j
f.p = g
f.y = g
f.x = h
f.s = a
j.u = n
n.v = e
n.s = a
h.q = a
h.p = a
h.r = a
h.s = m
h.v = j
h.w = j
h.u = n
h.t = n
assert g.q.u.s.u.s.s.s.txt == "m"