class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.q: C = None
        self.s: B = None
        self.y: E = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

c = A("c")
i = B("i")
m = C("m")
l = D("l")
f = E("f")
e = F("e")
d = B("d")
b = D("b")
n = E("n")

c.r = b
c.t = n
i.p = m
i.u = m
i.q = m
i.s = d
i.y = n
i.o = l
m.w = l
m.u = l
m.x = e
m.v = e
l.q = e
l.o = e
l.r = c
f.z = c
f.w = i
f.o = l
e.p = b
e.q = f
e.s = c
e.z = d
d.p = m
d.u = m
d.q = m
d.s = i
d.y = n
d.o = l
b.q = e
b.o = e
b.r = c
n.z = c
n.w = i
n.o = l
assert m.v.s.t.o.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: C = None
        self.q: C = None
        self.s: B = None
        self.y: E = None
        self.o: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: F = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.q: E = None
        self.s: A = None
        self.z: B = None
        self.txt = txt

c = A("c")
i = B("i")
m = C("m")
l = D("l")
f = E("f")
e = F("e")
d = B("d")
b = D("b")
n = E("n")

c.r = b
c.t = n
i.p = m
i.u = m
i.q = m
i.s = d
i.y = n
i.o = l
m.w = l
m.u = l
m.x = e
m.v = e
l.q = e
l.o = e
l.r = c
f.z = c
f.w = i
f.o = l
e.p = b
e.q = f
e.s = c
e.z = d
d.p = m
d.u = m
d.q = m
d.s = i
d.y = n
d.o = l
b.q = e
b.o = e
b.r = c
n.z = c
n.w = i
n.o = l
assert m.v.s.t.o.r.r.txt == "b"