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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: F = None
        self.t: C = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.o: C = None
        self.x: B = None
        self.v: G = None
        self.y: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.q: B = None
        self.v: H = None
        self.x: B = None
        self.p: F = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: G = None
        self.txt = txt

n = A("n")
i = B("i")
c = C("c")
b = D("b")
h = E("h")
d = F("d")
e = G("e")
g = H("g")

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

class B:
    def __init__(self, txt: str):
        self.u: C = None
        self.r: F = None
        self.t: C = None
        self.w: C = None
        self.z: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.v: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: B = None
        self.o: C = None
        self.x: B = None
        self.v: G = None
        self.y: F = None
        self.s: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: A = None
        self.o: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: H = None
        self.s: F = None
        self.q: B = None
        self.v: H = None
        self.x: B = None
        self.p: F = None
        self.y: C = None
        self.t: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: G = None
        self.txt = txt

n = A("n")
i = B("i")
c = C("c")
b = D("b")
h = E("h")
d = F("d")
e = G("e")
g = H("g")

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