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

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

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

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

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

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

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

a.v = b
a.r = b
a.u = k
e.o = b
e.t = m
k.s = b
k.y = m
n.s = k
n.o = e
m.x = k
m.u = b
m.q = a
b.o = k
assert n.o.t.q.u.s.o.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.r: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

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

a.v = b
a.r = b
a.u = k
e.o = b
e.t = m
k.s = b
k.y = m
n.s = k
n.o = e
m.x = k
m.u = b
m.q = a
b.o = k
assert n.o.t.q.u.s.o.txt == "k"