class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: E = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: B = None
        self.o: B = None
        self.y: F = None
        self.v: G = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: F = None
        self.t: C = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: B = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

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

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

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

k.z = n
k.q = c
k.y = c
k.r = j
h.r = c
h.v = k
a.z = n
a.y = n
a.q = h
a.o = h
a.v = j
a.w = k
g.w = h
g.p = n
g.y = n
g.t = a
c.p = j
c.w = h
c.s = n
c.v = k
n.u = a
j.z = k
j.q = k
m.w = h
m.p = n
m.y = n
m.t = a
assert k.r.z.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: E = None
        self.r: G = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: F = None
        self.q: B = None
        self.o: B = None
        self.y: F = None
        self.v: G = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: B = None
        self.p: F = None
        self.t: C = None
        self.y: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.w: B = None
        self.s: F = None
        self.v: A = None
        self.txt = txt

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

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

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

k.z = n
k.q = c
k.y = c
k.r = j
h.r = c
h.v = k
a.z = n
a.y = n
a.q = h
a.o = h
a.v = j
a.w = k
g.w = h
g.p = n
g.y = n
g.t = a
c.p = j
c.w = h
c.s = n
c.v = k
n.u = a
j.z = k
j.q = k
m.w = h
m.p = n
m.y = n
m.t = a
assert k.r.z.q.s.txt == "n"