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

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.q: C = None
        self.w: C = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: C = None
        self.z: A = None
        self.t: D = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

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

g.q = h
g.p = h
h.z = a
h.t = k
h.s = k
h.q = m
h.w = m
h.v = m
m.r = i
m.x = h
l.x = g
l.p = k
l.q = i
k.w = g
k.q = g
c.s = g
c.z = g
c.v = m
c.t = l
c.r = l
c.u = k
i.w = a
i.v = k
i.t = k
i.x = l
a.w = i
a.v = k
a.t = k
a.x = l
assert m.r.w.x.x.p.s.txt == "
class A:
    def __init__(self, txt: str):
        self.q: B = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.z: G = None
        self.t: E = None
        self.q: C = None
        self.w: C = None
        self.v: C = None
        self.s: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.v: C = None
        self.z: A = None
        self.t: D = None
        self.r: D = None
        self.u: E = None
        self.txt = txt

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

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

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