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

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

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

i = A("i")
g = B("g")
n = C("n")
l = A("l")
h = B("h")
e = A("e")
f = C("f")
c = C("c")
m = B("m")
k = C("k")

i.r = e
i.v = c
g.w = m
g.o = m
g.v = n
n.t = c
l.r = i
l.v = n
h.w = g
h.v = k
h.o = m
e.r = l
e.v = n
f.t = k
c.t = n
m.w = h
m.v = c
m.o = g
k.t = c
assert l.r.r.v.t.t.t.txt == "
class A:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: C = None
        self.txt = txt

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

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

i = A("i")
g = B("g")
n = C("n")
l = A("l")
h = B("h")
e = A("e")
f = C("f")
c = C("c")
m = B("m")
k = C("k")

i.r = e
i.v = c
g.w = m
g.o = m
g.v = n
n.t = c
l.r = i
l.v = n
h.w = g
h.v = k
h.o = m
e.r = l
e.v = n
f.t = k
c.t = n
m.w = h
m.v = c
m.o = g
k.t = c
assert l.r.r.v.t.t.t.txt == "c"