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

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

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

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

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

f.v = j
b.t = k
a.q = e
a.z = b
a.y = k
k.o = b
k.s = h
k.u = a
k.q = a
g.t = k
e.o = g
e.s = h
e.u = a
e.q = a
h.v = j
j.o = g
j.s = f
j.u = a
j.q = a
n.t = e
assert h.v.o.t.q.y.s.v.o.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: D = None
        self.txt = txt

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

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

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

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

f.v = j
b.t = k
a.q = e
a.z = b
a.y = k
k.o = b
k.s = h
k.u = a
k.q = a
g.t = k
e.o = g
e.s = h
e.u = a
e.q = a
h.v = j
j.o = g
j.s = f
j.u = a
j.q = a
n.t = e
assert h.v.o.t.q.y.s.v.o.t.txt == "k"