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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.w: C = None
        self.r: A = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: I = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: G = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: B = None
        self.w: D = None
        self.z: I = None
        self.x: I = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: I = None
        self.p: A = None
        self.t: F = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.w: C = None
        self.r: A = None
        self.o: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: I = None
        self.x: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: H = None
        self.r: G = None
        self.z: I = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: H = None
        self.u: B = None
        self.w: D = None
        self.z: I = None
        self.x: I = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: I = None
        self.p: A = None
        self.t: F = None
        self.x: G = None
        self.y: D = None
        self.txt = txt

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

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

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