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

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

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

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

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

b = A("b")
k = B("k")
e = C("e")
i = D("i")
g = E("g")
d = B("d")

b.o = e
b.z = e
k.u = i
k.x = i
k.w = e
k.v = d
k.p = g
e.z = d
e.w = i
e.t = g
i.x = b
i.t = b
i.u = e
g.o = i
d.u = i
d.x = i
d.w = e
d.v = k
d.p = g
assert b.z.t.o.txt == "
class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.z: C = None
        self.txt = txt

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

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

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

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

b = A("b")
k = B("k")
e = C("e")
i = D("i")
g = E("g")
d = B("d")

b.o = e
b.z = e
k.u = i
k.x = i
k.w = e
k.v = d
k.p = g
e.z = d
e.w = i
e.t = g
i.x = b
i.t = b
i.u = e
g.o = i
d.u = i
d.x = i
d.w = e
d.v = k
d.p = g
assert b.z.t.o.txt == "i"