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

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

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

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

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

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

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

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

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

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

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

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

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

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

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