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

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

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

h = A("h")
d = B("d")
g = C("g")
e = A("e")
f = C("f")
l = C("l")
c = C("c")
m = B("m")
j = B("j")
k = B("k")

h.v = e
h.q = f
d.x = k
d.s = c
g.t = h
g.u = f
e.v = h
e.q = g
f.t = e
f.u = c
l.t = e
l.u = g
c.t = e
c.u = f
m.x = k
m.s = c
j.x = d
j.s = f
k.x = d
k.s = g
assert c.u.u.t.q.u.t.q.u.t.v.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.q: C = None
        self.txt = txt

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

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

h = A("h")
d = B("d")
g = C("g")
e = A("e")
f = C("f")
l = C("l")
c = C("c")
m = B("m")
j = B("j")
k = B("k")

h.v = e
h.q = f
d.x = k
d.s = c
g.t = h
g.u = f
e.v = h
e.q = g
f.t = e
f.u = c
l.t = e
l.u = g
c.t = e
c.u = f
m.x = k
m.s = c
j.x = d
j.s = f
k.x = d
k.s = g
assert c.u.u.t.q.u.t.q.u.t.v.txt == "h"