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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.z: D = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: G = None
        self.t: H = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: C = None
        self.q: C = None
        self.z: I = None
        self.r: F = None
        self.w: E = None
        self.p: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: A = None
        self.x: B = None
        self.z: D = None
        self.o: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.q: D = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.v: G = None
        self.t: H = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.u: C = None
        self.q: C = None
        self.z: I = None
        self.r: F = None
        self.w: E = None
        self.p: I = None
        self.txt = txt

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

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

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