class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.y: B = None
        self.x: C = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

e.q = i
e.y = i
e.u = i
e.z = i
e.p = k
e.x = a
i.v = k
i.o = k
i.q = k
i.y = a
i.u = c
a.p = e
a.v = k
a.r = k
g.x = e
g.t = m
g.s = a
h.y = a
h.v = e
h.s = g
h.x = m
k.p = e
k.q = e
k.y = c
c.v = k
m.y = a
m.v = e
m.s = g
m.x = h
assert g.t.x.y.p.z.y.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: F = None
        self.y: B = None
        self.x: C = None
        self.u: B = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.x: A = None
        self.t: E = None
        self.s: C = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

e.q = i
e.y = i
e.u = i
e.z = i
e.p = k
e.x = a
i.v = k
i.o = k
i.q = k
i.y = a
i.u = c
a.p = e
a.v = k
a.r = k
g.x = e
g.t = m
g.s = a
h.y = a
h.v = e
h.s = g
h.x = m
k.p = e
k.q = e
k.y = c
c.v = k
m.y = a
m.v = e
m.s = g
m.x = h
assert g.t.x.y.p.z.y.txt == "a"