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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.txt = txt

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

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

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

k.u = m
k.v = d
k.o = l
k.p = n
n.p = k
n.x = k
n.y = l
n.v = l
m.u = k
m.o = k
m.w = e
m.v = d
m.y = d
m.t = l
e.s = l
d.x = l
d.r = l
d.p = e
d.u = k
l.u = n
assert m.u.v.r.u.txt == "n"