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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.q: E = None
        self.s: A = None
        self.w: D = None
        self.txt = txt

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

g = A("g")
n = B("n")
e = C("e")
i = D("i")
j = E("j")
a = F("a")
d = G("d")
l = G("l")
c = G("c")
m = D("m")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.p: D = None
        self.q: E = None
        self.s: A = None
        self.w: D = None
        self.txt = txt

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

g = A("g")
n = B("n")
e = C("e")
i = D("i")
j = E("j")
a = F("a")
d = G("d")
l = G("l")
c = G("c")
m = D("m")

g.p = e
g.y = e
g.u = e
g.q = l
g.z = n
n.q = e
e.y = g
i.o = c
i.r = g
i.x = a
i.t = a
i.u = l
i.w = j
j.p = i
a.z = g
a.s = g
a.p = m
a.q = j
a.w = i
d.w = e
l.w = e
c.w = e
m.o = c
m.r = g
m.x = a
m.t = a
m.u = l
m.w = j
assert c.w.y.q.w.y.q.w.y.txt == "g"