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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.t: A = None
        self.p: C = None
        self.q: G = None
        self.v: B = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.s: A = None
        self.t: A = None
        self.p: C = None
        self.q: G = None
        self.v: B = None
        self.w: D = None
        self.txt = txt

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

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

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