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

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

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

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

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

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

n = A("n")
h = B("h")
d = C("d")
c = D("c")
l = E("l")
e = F("e")
k = C("k")
g = A("g")

n.p = e
n.s = e
n.x = e
n.z = l
n.u = h
h.z = g
h.w = c
h.p = e
d.q = c
d.o = k
d.p = e
d.t = e
d.v = n
d.s = l
c.w = n
c.u = e
c.s = g
l.v = g
l.w = g
l.u = h
e.r = l
e.v = c
e.u = n
e.p = h
k.q = c
k.o = d
k.p = e
k.t = e
k.v = g
k.s = l
g.p = e
g.s = e
g.x = e
g.z = l
g.u = h
assert e.r.w.u.p.u.u.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.s: F = None
        self.z: E = None
        self.x: F = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

n = A("n")
h = B("h")
d = C("d")
c = D("c")
l = E("l")
e = F("e")
k = C("k")
g = A("g")

n.p = e
n.s = e
n.x = e
n.z = l
n.u = h
h.z = g
h.w = c
h.p = e
d.q = c
d.o = k
d.p = e
d.t = e
d.v = n
d.s = l
c.w = n
c.u = e
c.s = g
l.v = g
l.w = g
l.u = h
e.r = l
e.v = c
e.u = n
e.p = h
k.q = c
k.o = d
k.p = e
k.t = e
k.v = g
k.s = l
g.p = e
g.s = e
g.x = e
g.z = l
g.u = h
assert e.r.w.u.p.u.u.w.u.txt == "e"