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

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

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

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

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

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

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

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

l.y = e
f.w = h
f.v = h
f.t = j
b.y = h
b.w = f
b.q = j
m.y = b
e.y = f
e.w = f
e.q = i
c.y = h
c.w = f
c.q = l
h.w = f
h.v = f
h.t = m
j.y = e
i.y = b
assert f.t.y.q.y.y.t.y.w.txt == "f"