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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.q: B = None
        self.v: F = None
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.z: F = None
        self.p: A = None
        self.o: C = None
        self.x: B = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

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

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

i.q = h
a.o = m
m.u = l
l.w = a
l.q = a
l.x = i
l.y = i
l.v = d
h.t = l
h.y = l
h.s = d
d.p = i
j.u = i
j.p = i
j.t = i
j.v = m
j.o = m
j.z = d
j.x = a
j.y = a
e.v = h
assert h.s.p.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: A = None
        self.q: B = None
        self.v: F = None
        self.y: A = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.v: C = None
        self.z: F = None
        self.p: A = None
        self.o: C = None
        self.x: B = None
        self.y: B = None
        self.t: A = None
        self.txt = txt

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

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

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