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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.p: D = None
        self.r: F = None
        self.y: A = None
        self.o: A = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: E = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: A = None
        self.p: D = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: D = None
        self.y: G = None
        self.q: F = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: D = None
        self.o: C = None
        self.t: A = None
        self.u: C = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

d = A("d")
h = B("h")
n = C("n")
l = D("l")
a = E("a")
e = F("e")
i = G("i")
c = F("c")

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.p: D = None
        self.r: F = None
        self.y: A = None
        self.o: A = None
        self.x: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.v: E = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: A = None
        self.v: A = None
        self.p: D = None
        self.o: D = None
        self.z: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: D = None
        self.y: G = None
        self.q: F = None
        self.w: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.p: D = None
        self.o: C = None
        self.t: A = None
        self.u: C = None
        self.q: E = None
        self.v: B = None
        self.txt = txt

d = A("d")
h = B("h")
n = C("n")
l = D("l")
a = E("a")
e = F("e")
i = G("i")
c = F("c")

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