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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.s: F = None
        self.z: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.r: E = None
        self.v: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: F = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: F = None
        self.u: F = None
        self.s: F = None
        self.z: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: A = None
        self.u: C = None
        self.r: E = None
        self.v: G = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: A = None
        self.o: F = None
        self.w: F = None
        self.u: A = None
        self.txt = txt

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

n.w = b
n.p = k
n.s = j
h.p = a
h.u = a
h.s = a
h.z = g
m.r = a
k.o = n
g.v = h
g.w = b
g.r = n
g.z = m
a.x = n
a.u = m
a.o = m
a.r = g
a.v = b
b.x = n
b.u = n
b.o = a
b.w = a
j.p = a
j.u = a
j.s = a
j.z = g
assert b.o.o.r.r.z.txt == "m"