class A:
    def __init__(self, txt: str):
        self.q: C = None
        self.s: E = None
        self.o: E = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.t: H = None
        self.u: H = None
        self.s: C = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: I = None
        self.t: B = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: J = None
        self.z: H = None
        self.w: H = None
        self.x: G = None
        self.q: H = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: B = None
        self.o: I = None
        self.v: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: F = None
        self.r: I = None
        self.t: J = None
        self.s: F = None
        self.w: B = None
        self.q: D = None
        self.o: F = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: C = None
        self.t: H = None
        self.u: H = None
        self.s: C = None
        self.r: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: E = None
        self.s: J = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: I = None
        self.s: I = None
        self.t: B = None
        self.q: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: J = None
        self.z: H = None
        self.w: H = None
        self.x: G = None
        self.q: H = None
        self.u: C = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.p: B = None
        self.o: I = None
        self.v: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: D = None
        self.p: F = None
        self.r: I = None
        self.t: J = None
        self.s: F = None
        self.w: B = None
        self.q: D = None
        self.o: F = None
        self.y: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: G = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.s: G = None
        self.t: D = None
        self.txt = txt

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

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