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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: D = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: F = None
        self.w: C = None
        self.z: E = None
        self.o: A = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.y: D = None
        self.u: B = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

f = A("f")
i = B("i")
h = C("h")
j = D("j")
e = E("e")
b = F("b")
c = G("c")
d = B("d")
m = C("m")

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

class B:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: D = None
        self.p: E = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: F = None
        self.w: C = None
        self.z: E = None
        self.o: A = None
        self.x: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.y: D = None
        self.u: B = None
        self.v: B = None
        self.t: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

f = A("f")
i = B("i")
h = C("h")
j = D("j")
e = E("e")
b = F("b")
c = G("c")
d = B("d")
m = C("m")

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