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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: C = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

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

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

m.y = l
m.o = l
m.w = n
n.t = l
n.v = j
n.y = m
e.v = n
e.w = n
j.s = m
c.r = n
c.v = e
c.t = j
c.u = j
l.y = e
l.v = c
assert l.y.v.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.w: B = None
        self.o: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.v: C = None
        self.t: D = None
        self.u: D = None
        self.txt = txt

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

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

m.y = l
m.o = l
m.w = n
n.t = l
n.v = j
n.y = m
e.v = n
e.w = n
j.s = m
c.r = n
c.v = e
c.t = j
c.u = j
l.y = e
l.v = c
assert l.y.v.y.txt == "m"