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

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

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

c = A("c")
j = B("j")
h = C("h")
a = B("a")
e = C("e")
k = B("k")
b = A("b")
l = A("l")
n = C("n")

c.o = a
c.v = l
j.t = a
j.u = k
j.w = c
h.o = k
h.t = l
a.t = k
a.u = k
a.w = l
e.o = j
e.t = l
k.t = j
k.u = j
k.w = c
b.o = k
b.v = c
l.o = a
l.v = c
n.o = k
n.t = b
assert a.t.w.v.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: A = None
        self.txt = txt

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

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

c = A("c")
j = B("j")
h = C("h")
a = B("a")
e = C("e")
k = B("k")
b = A("b")
l = A("l")
n = C("n")

c.o = a
c.v = l
j.t = a
j.u = k
j.w = c
h.o = k
h.t = l
a.t = k
a.u = k
a.w = l
e.o = j
e.t = l
k.t = j
k.u = j
k.w = c
b.o = k
b.v = c
l.o = a
l.v = c
n.o = k
n.t = b
assert a.t.w.v.txt == "l"