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

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

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

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

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

g = A("g")
f = B("f")
k = C("k")
m = D("m")
l = E("l")
d = D("d")
c = E("c")
b = A("b")

g.p = k
g.r = k
g.z = k
g.w = b
g.t = b
f.v = k
f.p = k
f.x = c
f.z = d
k.x = f
k.t = l
m.w = l
m.t = d
m.v = f
l.o = c
d.w = c
d.t = m
d.v = f
c.o = l
b.p = k
b.r = k
b.z = k
b.w = g
b.t = g
assert c.o.o.o.o.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: C = None
        self.w: A = None
        self.z: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

g = A("g")
f = B("f")
k = C("k")
m = D("m")
l = E("l")
d = D("d")
c = E("c")
b = A("b")

g.p = k
g.r = k
g.z = k
g.w = b
g.t = b
f.v = k
f.p = k
f.x = c
f.z = d
k.x = f
k.t = l
m.w = l
m.t = d
m.v = f
l.o = c
d.w = c
d.t = m
d.v = f
c.o = l
b.p = k
b.r = k
b.z = k
b.w = g
b.t = g
assert c.o.o.o.o.txt == "c"