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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: G = None
        self.q: D = None
        self.txt = txt

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

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

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

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

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

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