class A:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: D = None
        self.q: E = None
        self.r: D = None
        self.z: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: G = None
        self.w: F = None
        self.x: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: E = None
        self.z: G = None
        self.w: F = None
        self.x: F = None
        self.txt = txt

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

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

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