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

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

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

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

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

d = A("d")
i = B("i")
n = C("n")
a = D("a")
f = E("f")
l = B("l")
b = D("b")

d.z = n
d.q = n
i.t = a
i.w = n
i.v = n
i.r = l
i.x = f
n.o = f
a.p = n
a.r = d
a.o = b
f.o = n
f.r = n
f.z = b
f.u = i
f.v = d
l.t = a
l.w = n
l.v = n
l.r = i
l.x = f
b.p = n
b.r = d
b.o = a
assert i.w.o.u.x.r.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.q: C = None
        self.txt = txt

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

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

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

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

d = A("d")
i = B("i")
n = C("n")
a = D("a")
f = E("f")
l = B("l")
b = D("b")

d.z = n
d.q = n
i.t = a
i.w = n
i.v = n
i.r = l
i.x = f
n.o = f
a.p = n
a.r = d
a.o = b
f.o = n
f.r = n
f.z = b
f.u = i
f.v = d
l.t = a
l.w = n
l.v = n
l.r = i
l.x = f
b.p = n
b.r = d
b.o = a
assert i.w.o.u.x.r.o.u.txt == "i"