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

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

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

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

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

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

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

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

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

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

k.z = f
k.x = i
k.u = i
k.v = i
i.s = c
l.v = f
l.s = f
l.t = i
n.z = i
n.o = j
g.v = f
g.s = f
g.t = i
c.z = i
c.o = e
e.z = i
e.o = n
j.z = i
j.o = c
d.z = f
d.x = i
d.u = i
d.v = i
f.v = l
f.s = l
f.t = i
assert e.z.s.z.txt == "i"