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

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

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

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

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

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

k = A("k")
d = B("d")
e = C("e")
a = D("a")
c = E("c")
n = F("n")
i = E("i")
j = B("j")

k.u = e
k.p = n
d.p = j
d.o = i
d.w = e
e.s = j
e.y = c
a.v = d
a.x = n
a.y = j
c.v = k
n.r = c
n.x = a
i.v = k
j.p = d
j.o = c
j.w = e
assert a.y.o.v.p.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

k = A("k")
d = B("d")
e = C("e")
a = D("a")
c = E("c")
n = F("n")
i = E("i")
j = B("j")

k.u = e
k.p = n
d.p = j
d.o = i
d.w = e
e.s = j
e.y = c
a.v = d
a.x = n
a.y = j
c.v = k
n.r = c
n.x = a
i.v = k
j.p = d
j.o = c
j.w = e
assert a.y.o.v.p.txt == "n"