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

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

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

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

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

b = A("b")
j = B("j")
i = C("i")
e = D("e")
l = E("l")
d = B("d")
f = D("f")
a = D("a")
g = A("g")
c = C("c")

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

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

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

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

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

b = A("b")
j = B("j")
i = C("i")
e = D("e")
l = E("l")
d = B("d")
f = D("f")
a = D("a")
g = A("g")
c = C("c")

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