class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: B = None
        self.q: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.u: E = None
        self.s: G = None
        self.q: I = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: E = None
        self.u: E = None
        self.s: G = None
        self.q: I = None
        self.txt = txt

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

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

h.x = m
h.p = d
h.q = l
h.r = b
i.s = h
a.q = l
a.y = l
a.z = h
a.s = b
a.u = d
a.o = c
a.v = c
a.p = c
b.x = l
n.p = b
l.q = b
l.w = e
l.r = n
l.s = m
l.u = d
c.r = m
c.s = n
c.z = n
m.r = i
m.p = n
m.u = n
m.s = c
m.q = e
e.r = h
d.s = h
assert i.s.r.x.q.x.q.x.q.x.w.txt == "e"