class A:
    def __init__(self, txt: str):
        self.v: C = 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.u: E = None
        self.w: E = None
        self.r: A = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

m.v = n
i.u = k
n.u = e
n.w = f
n.v = f
n.r = k
n.p = i
j.t = i
j.o = m
j.y = m
j.v = k
f.y = j
c.z = m
c.p = e
c.y = e
c.r = i
c.x = k
e.y = j
k.v = n
b.z = m
b.x = m
b.p = f
b.r = i
b.y = e
a.z = k
a.x = k
a.p = e
a.r = i
a.y = f
assert n.r.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: C = 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.u: E = None
        self.w: E = None
        self.r: A = None
        self.v: E = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

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

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

m.v = n
i.u = k
n.u = e
n.w = f
n.v = f
n.r = k
n.p = i
j.t = i
j.o = m
j.y = m
j.v = k
f.y = j
c.z = m
c.p = e
c.y = e
c.r = i
c.x = k
e.y = j
k.v = n
b.z = m
b.x = m
b.p = f
b.r = i
b.y = e
a.z = k
a.x = k
a.p = e
a.r = i
a.y = f
assert n.r.v.u.txt == "e"