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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.q: E = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: F = None
        self.r: A = None
        self.o: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: C = None
        self.w: I = None
        self.q: E = None
        self.o: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.x: A = None
        self.z: F = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
c = D("c")
k = E("k")
g = F("g")
e = G("e")
n = H("n")
a = I("a")

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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: F = None
        self.q: E = None
        self.o: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: F = None
        self.r: A = None
        self.o: A = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: H = None
        self.x: C = None
        self.w: I = None
        self.q: E = None
        self.o: I = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: E = None
        self.u: C = None
        self.x: A = None
        self.z: F = None
        self.t: B = None
        self.s: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

d = A("d")
h = B("h")
l = C("l")
c = D("c")
k = E("k")
g = F("g")
e = G("e")
n = H("n")
a = I("a")

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