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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.v: F = None
        self.y: G = None
        self.w: G = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: B = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: H = None
        self.v: H = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: D = None
        self.s: F = None
        self.w: G = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: F = None
        self.t: E = None
        self.v: F = None
        self.y: G = None
        self.w: G = None
        self.o: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.p: B = None
        self.z: C = None
        self.o: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.r: B = None
        self.s: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: A = None
        self.r: H = None
        self.v: H = None
        self.y: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.x: D = None
        self.s: F = None
        self.w: G = None
        self.txt = txt

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

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