class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.y: D = None
        self.w: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: D = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: G = None
        self.v: F = None
        self.t: H = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: H = None
        self.x: C = None
        self.o: E = None
        self.u: E = None
        self.v: F = None
        self.y: G = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: A = None
        self.v: F = None
        self.z: F = None
        self.w: H = None
        self.s: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: F = None
        self.s: F = None
        self.w: E = None
        self.txt = txt

l = A("l")
n = B("n")
d = C("d")
i = D("i")
a = E("a")
h = F("h")
f = G("f")
j = H("j")
c = B("c")
g = F("g")

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

class B:
    def __init__(self, txt: str):
        self.x: C = None
        self.q: D = None
        self.t: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.w: G = None
        self.q: G = None
        self.v: F = None
        self.t: H = None
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: H = None
        self.x: C = None
        self.o: E = None
        self.u: E = None
        self.v: F = None
        self.y: G = None
        self.q: D = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.y: H = None
        self.p: A = None
        self.v: F = None
        self.z: F = None
        self.w: H = None
        self.s: D = None
        self.r: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: F = None
        self.s: F = None
        self.w: E = None
        self.txt = txt

l = A("l")
n = B("n")
d = C("d")
i = D("i")
a = E("a")
h = F("h")
f = G("f")
j = H("j")
c = B("c")
g = F("g")

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