class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: B = None
        self.q: A = None
        self.txt = txt

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

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

n.s = h
n.w = l
n.q = g
k.p = h
l.u = i
l.z = i
l.w = g
l.o = h
l.v = h
l.q = h
l.t = j
h.t = j
i.r = l
i.p = a
i.x = h
i.q = k
a.s = n
a.q = n
a.z = k
g.u = k
g.w = l
j.s = h
j.w = l
j.q = g
assert h.t.s.t.w.u.x.t.w.txt == "
class A:
    def __init__(self, txt: str):
        self.s: D = None
        self.w: C = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.z: B = None
        self.q: A = None
        self.txt = txt

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

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

n.s = h
n.w = l
n.q = g
k.p = h
l.u = i
l.z = i
l.w = g
l.o = h
l.v = h
l.q = h
l.t = j
h.t = j
i.r = l
i.p = a
i.x = h
i.q = k
a.s = n
a.q = n
a.z = k
g.u = k
g.w = l
j.s = h
j.w = l
j.q = g
assert h.t.s.t.w.u.x.t.w.txt == "l"