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

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

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

d = A("d")
j = B("j")
g = C("g")
m = A("m")
i = A("i")
l = C("l")
e = B("e")
f = A("f")

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

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

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

d = A("d")
j = B("j")
g = C("g")
m = A("m")
i = A("i")
l = C("l")
e = B("e")
f = A("f")

d.w = j
d.t = i
j.w = e
j.u = e
j.o = d
g.v = e
g.y = e
g.r = j
m.w = j
m.t = f
i.w = j
i.t = f
l.v = e
l.r = e
l.y = j
e.w = j
e.u = j
e.o = d
f.w = j
f.t = d
assert i.t.w.w.txt == "e"