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

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

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

a = A("a")
m = B("m")
g = C("g")
b = A("b")
e = B("e")
j = B("j")
d = B("d")
n = A("n")
l = C("l")
f = B("f")

a.o = m
a.w = n
m.r = g
m.v = f
m.t = j
g.v = l
g.p = l
g.u = n
b.o = m
b.w = a
e.r = l
e.v = d
e.t = m
j.r = l
j.v = m
j.t = d
d.r = l
d.v = f
d.t = j
n.o = f
n.w = b
l.v = g
l.p = g
l.u = n
f.r = g
f.v = j
f.t = j
assert j.v.t.v.v.r.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: A = None
        self.txt = txt

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

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

a = A("a")
m = B("m")
g = C("g")
b = A("b")
e = B("e")
j = B("j")
d = B("d")
n = A("n")
l = C("l")
f = B("f")

a.o = m
a.w = n
m.r = g
m.v = f
m.t = j
g.v = l
g.p = l
g.u = n
b.o = m
b.w = a
e.r = l
e.v = d
e.t = m
j.r = l
j.v = m
j.t = d
d.r = l
d.v = f
d.t = j
n.o = f
n.w = b
l.v = g
l.p = g
l.u = n
f.r = g
f.v = j
f.t = j
assert j.v.t.v.v.r.txt == "g"