class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.p: C = None
        self.r: F = None
        self.s: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.o: B = None
        self.x: G = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.p: C = None
        self.t: D = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.x: F = None
        self.p: F = None
        self.z: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: G = None
        self.w: F = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: H = None
        self.o: B = None
        self.x: G = None
        self.p: E = None
        self.u: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: C = None
        self.u: E = None
        self.p: C = None
        self.t: D = None
        self.q: A = None
        self.z: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: B = None
        self.x: F = None
        self.p: F = None
        self.z: F = None
        self.txt = txt

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

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

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