class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: G = None
        self.q: F = None
        self.u: G = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.z: B = None
        self.p: E = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.p: D = None
        self.q: F = None
        self.t: F = None
        self.r: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: H = None
        self.v: A = None
        self.y: A = None
        self.t: D = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.y: E = None
        self.txt = txt

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

l = A("l")
m = B("m")
a = C("a")
j = D("j")
h = E("h")
e = F("e")
k = G("k")
c = H("c")
b = F("b")
d = D("d")

l.o = k
l.w = k
l.u = k
l.q = b
l.r = c
m.y = c
a.q = h
a.y = j
j.r = l
j.q = b
j.z = m
j.p = h
j.x = c
h.o = l
h.y = l
h.w = j
h.p = j
h.q = b
h.t = b
h.r = e
e.p = j
e.z = c
e.v = l
e.y = l
e.u = l
e.t = d
e.w = b
k.w = b
k.o = m
k.y = h
c.p = a
c.r = a
c.s = b
c.q = h
c.z = l
c.v = k
c.t = j
b.p = j
b.t = j
b.z = c
b.v = l
b.y = l
b.u = l
b.w = e
d.r = l
d.q = e
d.z = m
d.p = h
d.x = c
assert a.q.t.z.z.q.w.w.w.p.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: G = None
        self.w: G = None
        self.q: F = None
        self.u: G = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: H = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: F = None
        self.z: B = None
        self.p: E = None
        self.x: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.w: D = None
        self.p: D = None
        self.q: F = None
        self.t: F = None
        self.r: F = None
        self.y: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: H = None
        self.v: A = None
        self.y: A = None
        self.t: D = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: B = None
        self.y: E = None
        self.txt = txt

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

l = A("l")
m = B("m")
a = C("a")
j = D("j")
h = E("h")
e = F("e")
k = G("k")
c = H("c")
b = F("b")
d = D("d")

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