class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: E = None
        self.s: D = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: D = None
        self.t: E = None
        self.w: F = None
        self.z: F = None
        self.v: A = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: D = None
        self.t: E = None
        self.w: F = None
        self.z: F = None
        self.v: A = None
        self.txt = txt

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

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