class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.x: F = None
        self.r: F = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

a.y = n
a.z = i
n.s = e
n.t = i
n.p = i
n.y = i
n.q = c
n.w = c
n.r = m
c.z = a
c.t = e
c.x = e
c.r = e
c.p = n
c.w = i
b.q = n
b.r = i
b.p = i
b.x = i
b.z = c
m.z = a
m.t = c
m.w = c
e.s = i
e.w = i
e.p = b
e.y = h
e.x = c
e.t = m
i.o = n
i.z = c
h.z = a
h.t = c
h.w = c
assert a.z.z.p.w.w.o.w.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: F = None
        self.x: F = None
        self.r: F = None
        self.p: B = None
        self.w: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: C = None
        self.txt = txt

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

a.y = n
a.z = i
n.s = e
n.t = i
n.p = i
n.y = i
n.q = c
n.w = c
n.r = m
c.z = a
c.t = e
c.x = e
c.r = e
c.p = n
c.w = i
b.q = n
b.r = i
b.p = i
b.x = i
b.z = c
m.z = a
m.t = c
m.w = c
e.s = i
e.w = i
e.p = b
e.y = h
e.x = c
e.t = m
i.o = n
i.z = c
h.z = a
h.t = c
h.w = c
assert a.z.z.p.w.w.o.w.x.txt == "e"