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

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

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

g = A("g")
i = B("i")
k = C("k")
h = A("h")
m = C("m")
a = B("a")
j = C("j")
c = B("c")
e = C("e")

g.v = h
g.y = j
i.u = c
i.s = j
i.t = m
k.r = c
h.v = g
h.y = m
m.r = c
a.u = i
a.s = e
a.t = e
j.r = i
c.u = a
c.s = k
c.t = j
e.r = c
assert a.u.t.r.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.y: C = None
        self.txt = txt

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

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

g = A("g")
i = B("i")
k = C("k")
h = A("h")
m = C("m")
a = B("a")
j = C("j")
c = B("c")
e = C("e")

g.v = h
g.y = j
i.u = c
i.s = j
i.t = m
k.r = c
h.v = g
h.y = m
m.r = c
a.u = i
a.s = e
a.t = e
j.r = i
c.u = a
c.s = k
c.t = j
e.r = c
assert a.u.t.r.u.u.u.u.txt == "a"