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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: E = None
        self.p: F = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: E = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.x: E = None
        self.p: F = None
        self.v: E = None
        self.z: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.s: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.z: E = None
        self.p: A = None
        self.u: B = None
        self.txt = txt

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

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