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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: E = None
        self.t: C = None
        self.s: H = None
        self.q: A = None
        self.u: E = None
        self.p: G = None
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.o: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: F = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: E = None
        self.t: C = None
        self.s: H = None
        self.q: A = None
        self.u: E = None
        self.p: G = None
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: H = None
        self.o: C = None
        self.y: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: F = None
        self.u: C = None
        self.q: B = None
        self.txt = txt

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

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