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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.v: B = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
h = C("h")
d = D("d")
f = E("f")
b = C("b")
k = B("k")
i = C("i")
j = A("j")

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

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

class C:
    def __init__(self, txt: str):
        self.t: E = None
        self.p: A = None
        self.v: B = None
        self.q: D = None
        self.s: B = None
        self.txt = txt

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

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

m = A("m")
a = B("a")
h = C("h")
d = D("d")
f = E("f")
b = C("b")
k = B("k")
i = C("i")
j = A("j")

m.p = a
a.x = f
a.z = f
h.t = f
h.p = j
h.v = k
h.q = d
h.s = a
d.o = h
f.q = j
f.z = d
f.r = m
f.t = h
b.t = f
b.p = j
b.v = k
b.q = d
b.s = a
k.x = f
k.z = f
i.t = f
i.p = j
i.v = a
i.s = a
i.q = d
j.p = a
assert f.r.p.z.t.p.p.z.t.txt == "h"