class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.q: B = None
        self.o: D = None
        self.r: E = None
        self.u: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: E = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: A = None
        self.w: D = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: C = None
        self.q: D = None
        self.x: C = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.s: A = None
        self.q: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: E = None
        self.z: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.o: A = None
        self.w: D = None
        self.p: D = None
        self.y: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: E = None
        self.o: C = None
        self.q: D = None
        self.x: C = None
        self.w: C = None
        self.y: G = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: B = None
        self.t: E = None
        self.s: A = None
        self.q: F = None
        self.txt = txt

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

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