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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

n.p = b
n.s = k
n.y = i
n.q = d
n.r = h
a.w = h
a.r = h
a.y = e
k.s = d
k.y = i
k.x = i
e.r = i
e.u = i
e.w = d
e.z = b
b.w = k
h.q = b
h.z = a
h.y = k
h.x = k
h.r = e
i.u = h
i.y = k
i.q = b
d.p = b
d.s = k
d.y = i
d.q = n
d.r = h
assert e.z.w.x.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: C = None
        self.y: G = None
        self.q: A = None
        self.r: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: G = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.txt = txt

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

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

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

n.p = b
n.s = k
n.y = i
n.q = d
n.r = h
a.w = h
a.r = h
a.y = e
k.s = d
k.y = i
k.x = i
e.r = i
e.u = i
e.w = d
e.z = b
b.w = k
h.q = b
h.z = a
h.y = k
h.x = k
h.r = e
i.u = h
i.y = k
i.q = b
d.p = b
d.s = k
d.y = i
d.q = n
d.r = h
assert e.z.w.x.y.txt == "k"