class A:
    def __init__(self, txt: str):
        self.q: H = None
        self.o: E = None
        self.s: C = None
        self.u: H = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: E = None
        self.p: D = None
        self.y: B = None
        self.q: B = None
        self.x: G = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: A = None
        self.p: A = None
        self.t: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.u: E = None
        self.p: D = None
        self.y: B = None
        self.q: B = None
        self.x: G = None
        self.txt = txt

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

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

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

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