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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: D = None
        self.v: G = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: A = None
        self.q: C = None
        self.s: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

j = A("j")
d = B("d")
m = C("m")
a = D("a")
e = E("e")
i = F("i")
h = G("h")
f = G("f")
g = A("g")

j.s = a
d.y = j
d.s = a
d.v = h
d.q = i
m.w = j
m.p = j
m.x = a
m.q = a
m.u = e
m.v = f
a.o = m
a.q = m
a.r = g
a.s = h
a.p = i
e.s = d
e.r = a
e.q = a
e.x = i
i.z = g
h.p = d
h.q = d
h.y = i
h.z = f
h.u = f
h.s = a
f.p = d
f.q = d
f.y = i
f.z = h
f.u = h
f.s = a
g.s = a
assert i.z.s.s.z.p.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.s: D = None
        self.v: G = None
        self.q: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: A = None
        self.q: C = None
        self.s: G = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: B = None
        self.r: D = None
        self.q: D = None
        self.x: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.txt = txt

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

j = A("j")
d = B("d")
m = C("m")
a = D("a")
e = E("e")
i = F("i")
h = G("h")
f = G("f")
g = A("g")

j.s = a
d.y = j
d.s = a
d.v = h
d.q = i
m.w = j
m.p = j
m.x = a
m.q = a
m.u = e
m.v = f
a.o = m
a.q = m
a.r = g
a.s = h
a.p = i
e.s = d
e.r = a
e.q = a
e.x = i
i.z = g
h.p = d
h.q = d
h.y = i
h.z = f
h.u = f
h.s = a
f.p = d
f.q = d
f.y = i
f.z = h
f.u = h
f.s = a
g.s = a
assert i.z.s.s.z.p.txt == "d"