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

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

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

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

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

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

b.x = m
b.r = c
b.p = g
b.u = e
l.z = b
l.v = c
e.s = g
e.x = i
e.z = m
i.x = k
c.o = b
c.x = k
k.o = m
k.x = c
d.s = f
d.x = i
d.z = m
g.z = b
g.v = c
m.x = b
m.r = c
m.p = l
m.u = e
f.z = b
f.v = k
assert g.z.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.x: A = None
        self.r: E = None
        self.p: B = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

b.x = m
b.r = c
b.p = g
b.u = e
l.z = b
l.v = c
e.s = g
e.x = i
e.z = m
i.x = k
c.o = b
c.x = k
k.o = m
k.x = c
d.s = f
d.x = i
d.z = m
g.z = b
g.v = c
m.x = b
m.r = c
m.p = l
m.u = e
f.z = b
f.v = k
assert g.z.p.v.txt == "c"