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

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

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

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

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

e.v = a
e.x = l
a.v = k
a.o = l
f.v = c
f.u = k
l.o = c
l.q = e
l.y = j
l.t = a
g.v = a
g.x = l
b.v = k
b.x = l
k.v = a
k.o = l
j.v = k
j.x = l
c.v = f
c.u = k
assert k.o.o.u.o.t.v.o.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

e.v = a
e.x = l
a.v = k
a.o = l
f.v = c
f.u = k
l.o = c
l.q = e
l.y = j
l.t = a
g.v = a
g.x = l
b.v = k
b.x = l
k.v = a
k.o = l
j.v = k
j.x = l
c.v = f
c.u = k
assert k.o.o.u.o.t.v.o.t.v.txt == "k"