class A:
    def __init__(self, txt: str):
        self.v: A = None
        self.r: D = None
        self.q: A = None
        self.p: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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