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

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

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

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

j = A("j")
f = B("f")
g = C("g")
k = D("k")
d = B("d")
i = D("i")
e = C("e")
l = B("l")
a = A("a")

j.x = e
j.y = f
f.r = d
f.z = e
f.v = e
g.o = e
g.u = i
g.x = j
k.y = i
d.r = l
d.z = e
d.v = g
i.y = k
e.o = g
e.u = i
e.x = a
l.r = f
l.z = e
l.v = g
a.x = e
a.y = l
assert g.u.y.y.y.y.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.y: B = None
        self.txt = txt

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

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

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

j = A("j")
f = B("f")
g = C("g")
k = D("k")
d = B("d")
i = D("i")
e = C("e")
l = B("l")
a = A("a")

j.x = e
j.y = f
f.r = d
f.z = e
f.v = e
g.o = e
g.u = i
g.x = j
k.y = i
d.r = l
d.z = e
d.v = g
i.y = k
e.o = g
e.u = i
e.x = a
l.r = f
l.z = e
l.v = g
a.x = e
a.y = l
assert g.u.y.y.y.y.y.y.txt == "i"