class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: D = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.y: E = None
        self.s: F = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.t: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.w: D = None
        self.txt = txt

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

m.w = i
m.q = i
m.x = n
m.s = n
l.s = m
l.o = n
i.p = n
i.u = n
i.y = j
i.t = j
i.s = e
i.x = m
n.x = j
n.y = l
n.t = l
n.q = e
j.y = n
e.t = l
e.r = i
e.w = n
assert j.y.x.y.y.s.x.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: D = None
        self.s: D = None
        self.q: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: D = None
        self.y: E = None
        self.s: F = None
        self.x: A = None
        self.t: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: B = None
        self.t: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: C = None
        self.w: D = None
        self.txt = txt

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

m.w = i
m.q = i
m.x = n
m.s = n
l.s = m
l.o = n
i.p = n
i.u = n
i.y = j
i.t = j
i.s = e
i.x = m
n.x = j
n.y = l
n.t = l
n.q = e
j.y = n
e.t = l
e.r = i
e.w = n
assert j.y.x.y.y.s.x.txt == "n"