class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: D = None
        self.w: G = None
        self.u: C = None
        self.o: G = None
        self.p: C = None
        self.v: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: G = None
        self.u: F = None
        self.z: A = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: A = None
        self.v: G = None
        self.u: F = None
        self.z: A = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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