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

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

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

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

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

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

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

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

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

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

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

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

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

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

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