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

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

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

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

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

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

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

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

j.w = c
j.o = b
j.u = b
k.s = l
e.t = k
e.q = j
e.x = l
b.w = h
b.o = j
b.u = l
f.t = h
f.q = l
f.x = j
a.t = h
a.q = b
a.x = j
h.s = l
l.w = k
l.o = b
l.u = b
n.t = k
n.q = l
n.x = l
c.s = b
assert f.q.w.s.txt == "l"