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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: E = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.x: F = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: F = None
        self.u: A = None
        self.t: A = None
        self.p: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.y: G = None
        self.z: E = None
        self.r: B = None
        self.t: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: E = None
        self.x: F = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: F = None
        self.u: A = None
        self.t: A = None
        self.p: F = None
        self.txt = txt

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

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