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

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

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

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

e.r = f
n.w = m
n.v = f
n.u = f
f.o = m
f.w = l
f.x = j
d.r = f
m.w = g
m.v = f
m.u = f
j.w = n
j.v = f
j.u = f
l.r = f
g.w = n
g.v = f
g.u = f
b.r = f
assert b.r.w.r.x.v.o.u.txt == "
class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

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

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

e.r = f
n.w = m
n.v = f
n.u = f
f.o = m
f.w = l
f.x = j
d.r = f
m.w = g
m.v = f
m.u = f
j.w = n
j.v = f
j.u = f
l.r = f
g.w = n
g.v = f
g.u = f
b.r = f
assert b.r.w.r.x.v.o.u.txt == "f"