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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: D = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.r: G = None
        self.u: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: G = None
        self.v: D = None
        self.x: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

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