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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: A = None
        self.u: B = None
        self.v: H = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

k = A("k")
e = B("e")
h = C("h")
f = D("f")
a = E("a")
j = F("j")
g = G("g")
n = H("n")
l = A("l")

k.w = h
k.x = a
e.u = a
e.x = a
h.w = f
h.t = n
h.x = e
h.s = a
f.p = a
f.u = n
f.q = g
a.t = h
a.o = k
a.u = e
a.p = e
a.v = n
a.y = f
j.v = h
g.x = a
g.q = f
n.s = a
n.t = g
n.q = g
l.w = h
l.x = a
assert n.q.x.t.x.u.t.w.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: E = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.o: A = None
        self.u: B = None
        self.v: H = None
        self.p: B = None
        self.y: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.x: E = None
        self.q: D = None
        self.txt = txt

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

k = A("k")
e = B("e")
h = C("h")
f = D("f")
a = E("a")
j = F("j")
g = G("g")
n = H("n")
l = A("l")

k.w = h
k.x = a
e.u = a
e.x = a
h.w = f
h.t = n
h.x = e
h.s = a
f.p = a
f.u = n
f.q = g
a.t = h
a.o = k
a.u = e
a.p = e
a.v = n
a.y = f
j.v = h
g.x = a
g.q = f
n.s = a
n.t = g
n.q = g
l.w = h
l.x = a
assert n.q.x.t.x.u.t.w.q.txt == "g"