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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: E = None
        self.w: G = None
        self.u: D = None
        self.s: H = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.t: A = None
        self.o: B = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: G = None
        self.r: D = None
        self.w: F = None
        self.v: H = None
        self.s: I = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

k = A("k")
i = B("i")
d = C("d")
b = D("b")
f = E("f")
e = F("e")
h = G("h")
j = H("j")
g = I("g")
a = F("a")

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

class B:
    def __init__(self, txt: str):
        self.y: E = None
        self.s: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.t: E = None
        self.w: G = None
        self.u: D = None
        self.s: H = None
        self.v: H = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.t: A = None
        self.o: B = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: G = None
        self.z: G = None
        self.r: D = None
        self.w: F = None
        self.v: H = None
        self.s: I = None
        self.t: A = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

k = A("k")
i = B("i")
d = C("d")
b = D("b")
f = E("f")
e = F("e")
h = G("h")
j = H("j")
g = I("g")
a = F("a")

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