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

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

m = A("m")
c = B("c")
l = C("l")
f = D("f")
k = E("k")
e = F("e")

m.v = k
m.y = f
m.o = e
m.p = c
c.w = k
c.x = k
c.s = e
l.q = m
f.v = l
f.q = e
f.u = e
f.w = m
f.p = m
k.t = l
k.p = m
e.q = k
assert f.v.q.v.t.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: D = None
        self.o: F = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

m = A("m")
c = B("c")
l = C("l")
f = D("f")
k = E("k")
e = F("e")

m.v = k
m.y = f
m.o = e
m.p = c
c.w = k
c.x = k
c.s = e
l.q = m
f.v = l
f.q = e
f.u = e
f.w = m
f.p = m
k.t = l
k.p = m
e.q = k
assert f.v.q.v.t.q.txt == "m"