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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.u: A = None
        self.txt = txt

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

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

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

e.p = k
e.y = k
e.v = l
e.u = a
e.x = i
l.v = j
l.r = d
l.y = d
l.p = n
k.q = n
g.u = a
i.y = a
i.p = e
i.v = g
n.r = g
n.z = g
n.w = j
n.p = d
n.y = l
d.v = j
d.r = l
d.y = l
d.p = n
j.y = a
j.p = a
j.v = g
a.p = k
a.y = k
a.v = l
a.u = e
a.x = j
assert n.w.v.u.v.y.p.txt == "n"