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

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

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

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

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

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

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

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

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

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

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