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

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

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

i = A("i")
f = B("f")
b = C("b")
l = A("l")
m = B("m")
a = A("a")
d = C("d")
e = A("e")
c = A("c")
j = C("j")

i.y = j
f.v = e
f.w = m
f.u = d
b.q = e
b.w = j
b.y = m
l.y = b
m.v = c
m.w = f
m.u = d
a.y = j
d.q = l
d.w = b
d.y = f
e.y = j
c.y = b
j.q = l
j.w = b
j.y = m
assert j.w.w.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

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

i = A("i")
f = B("f")
b = C("b")
l = A("l")
m = B("m")
a = A("a")
d = C("d")
e = A("e")
c = A("c")
j = C("j")

i.y = j
f.v = e
f.w = m
f.u = d
b.q = e
b.w = j
b.y = m
l.y = b
m.v = c
m.w = f
m.u = d
a.y = j
d.q = l
d.w = b
d.y = f
e.y = j
c.y = b
j.q = l
j.w = b
j.y = m
assert j.w.w.q.y.txt == "b"