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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: E = None
        self.t: D = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: A = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: D = None
        self.u: E = None
        self.t: D = None
        self.z: D = None
        self.x: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: F = None
        self.w: A = None
        self.u: A = None
        self.o: B = None
        self.txt = txt

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

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

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