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

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.p: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.z: C = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: B = None
        self.q: A = None
        self.x: B = None
        self.u: D = None
        self.p: B = None
        self.txt = txt

e = A("e")
l = B("l")
j = C("j")
k = D("k")
f = E("f")
i = F("i")
n = A("n")

e.w = i
e.t = i
e.p = n
l.q = f
j.r = l
j.t = l
j.p = k
j.o = n
k.q = j
k.v = i
k.w = e
f.o = l
f.r = l
f.t = k
f.z = j
f.y = j
i.t = e
i.z = l
i.x = l
i.p = l
i.q = n
i.u = k
n.w = i
n.t = i
n.p = e
assert k.q.o.p.p.p.p.t.txt == "
class A:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.p: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: B = None
        self.p: D = None
        self.o: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: F = None
        self.w: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.t: D = None
        self.z: C = None
        self.r: B = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: A = None
        self.z: B = None
        self.q: A = None
        self.x: B = None
        self.u: D = None
        self.p: B = None
        self.txt = txt

e = A("e")
l = B("l")
j = C("j")
k = D("k")
f = E("f")
i = F("i")
n = A("n")

e.w = i
e.t = i
e.p = n
l.q = f
j.r = l
j.t = l
j.p = k
j.o = n
k.q = j
k.v = i
k.w = e
f.o = l
f.r = l
f.t = k
f.z = j
f.y = j
i.t = e
i.z = l
i.x = l
i.p = l
i.q = n
i.u = k
n.w = i
n.t = i
n.p = e
assert k.q.o.p.p.p.p.t.txt == "i"