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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: B = None
        self.txt = txt

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

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