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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: D = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.y: H = None
        self.p: B = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: H = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
m = C("m")
b = D("b")
h = E("h")
i = F("i")
l = G("l")
d = H("d")
g = G("g")

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

class B:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: D = None
        self.r: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: D = None
        self.o: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: E = None
        self.y: H = None
        self.p: B = None
        self.x: A = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.q: H = None
        self.w: F = None
        self.p: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: G = None
        self.s: H = None
        self.x: E = None
        self.t: E = None
        self.txt = txt

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

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

j = A("j")
n = B("n")
m = C("m")
b = D("b")
h = E("h")
i = F("i")
l = G("l")
d = H("d")
g = G("g")

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