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

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

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

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

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

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

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

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

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

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

a.o = g
k.x = e
k.p = e
k.u = i
k.z = n
e.v = b
e.z = j
e.t = j
e.o = k
j.u = k
j.x = k
j.q = l
f.v = i
f.z = l
f.t = j
f.o = k
i.o = n
n.v = a
n.z = l
n.t = l
n.o = k
l.u = k
l.x = k
l.q = j
b.o = f
g.v = a
g.z = l
g.t = j
g.o = k
assert a.o.z.u.z.v.o.o.u.txt == "i"