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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.z: A = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.o: B = None
        self.z: A = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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

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