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

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

f = A("f")
n = B("n")
e = C("e")
i = D("i")
m = E("m")
g = E("g")
d = A("d")

f.v = g
f.w = n
f.x = d
f.z = m
n.o = m
e.p = i
e.o = i
e.t = g
e.z = n
e.q = d
i.u = n
m.o = d
m.q = i
m.u = n
g.o = d
g.q = i
g.u = n
d.v = g
d.w = n
d.x = f
d.z = m
assert i.u.o.u.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.w: B = None
        self.x: A = None
        self.z: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

f = A("f")
n = B("n")
e = C("e")
i = D("i")
m = E("m")
g = E("g")
d = A("d")

f.v = g
f.w = n
f.x = d
f.z = m
n.o = m
e.p = i
e.o = i
e.t = g
e.z = n
e.q = d
i.u = n
m.o = d
m.q = i
m.u = n
g.o = d
g.q = i
g.u = n
d.v = g
d.w = n
d.x = f
d.z = m
assert i.u.o.u.o.u.txt == "n"