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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.x: F = None
        self.z: F = None
        self.p: D = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

h = A("h")
b = B("b")
e = C("e")
f = D("f")
d = E("d")
j = F("j")
l = A("l")
a = D("a")

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.y: C = None
        self.x: F = None
        self.z: F = None
        self.p: D = None
        self.s: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.t: F = None
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: D = None
        self.txt = txt

h = A("h")
b = B("b")
e = C("e")
f = D("f")
d = E("d")
j = F("j")
l = A("l")
a = D("a")

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