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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: A = None
        self.w: G = None
        self.s: G = None
        self.v: A = None
        self.u: C = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.y: E = None
        self.t: G = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: A = None
        self.w: G = None
        self.s: G = None
        self.v: A = None
        self.u: C = None
        self.y: A = None
        self.p: F = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.y: E = None
        self.t: G = None
        self.v: E = None
        self.z: A = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

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

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