class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.o: A = None
        self.s: A = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: B = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

e = A("e")
m = B("m")
j = C("j")
i = D("i")
c = E("c")
h = F("h")
l = G("l")
a = H("a")

e.p = j
e.q = i
m.x = i
m.z = a
j.q = c
j.x = i
j.p = i
j.o = e
j.s = e
i.z = m
i.u = m
i.y = e
i.q = e
i.v = a
i.r = l
c.y = l
c.r = m
c.s = j
c.x = j
h.q = e
h.y = m
h.u = i
h.o = a
l.q = i
a.q = j
a.y = e
a.v = c
a.x = l
assert l.q.u.z.q.o.p.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.x: D = None
        self.o: A = None
        self.s: A = None
        self.p: D = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.y: B = None
        self.u: D = None
        self.o: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: C = None
        self.y: A = None
        self.v: E = None
        self.x: G = None
        self.txt = txt

e = A("e")
m = B("m")
j = C("j")
i = D("i")
c = E("c")
h = F("h")
l = G("l")
a = H("a")

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