class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.z: E = None
        self.o: C = None
        self.s: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.y: F = None
        self.x: E = None
        self.z: E = None
        self.o: C = None
        self.s: F = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

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