class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: H = None
        self.v: C = None
        self.w: G = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.r: H = None
        self.v: C = None
        self.w: G = None
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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