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

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

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

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

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

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

m = A("m")
e = B("e")
b = C("b")
j = D("j")
f = E("f")
l = F("l")

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

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

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

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

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

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

m = A("m")
e = B("e")
b = C("b")
j = D("j")
f = E("f")
l = F("l")

m.u = b
m.t = e
m.p = e
m.x = e
m.y = f
m.v = j
e.x = m
e.t = f
b.v = j
b.s = l
b.x = m
b.w = m
j.y = e
j.t = f
j.x = m
j.q = m
j.s = l
f.w = b
f.r = l
f.t = m
f.y = e
f.u = j
l.o = m
assert l.o.y.w.v.s.o.txt == "m"