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

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: E = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

n = A("n")
f = B("f")
j = C("j")
b = D("b")
g = E("g")
a = F("a")
l = G("l")
e = D("e")

n.s = j
n.w = j
n.u = l
n.r = a
n.o = e
n.t = g
f.w = a
f.r = a
f.s = g
f.p = b
j.w = a
j.t = n
j.z = n
b.q = a
b.z = a
b.y = n
b.o = f
b.t = l
g.z = n
g.s = f
g.p = f
g.x = f
a.q = f
a.s = l
a.w = g
a.t = j
l.u = j
e.q = a
e.z = a
e.y = n
e.o = f
e.t = l
assert g.p.p.o.txt == "
class A:
    def __init__(self, txt: str):
        self.s: C = None
        self.u: G = None
        self.r: F = None
        self.w: C = None
        self.o: D = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: F = None
        self.s: E = None
        self.p: D = None
        self.r: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

n = A("n")
f = B("f")
j = C("j")
b = D("b")
g = E("g")
a = F("a")
l = G("l")
e = D("e")

n.s = j
n.w = j
n.u = l
n.r = a
n.o = e
n.t = g
f.w = a
f.r = a
f.s = g
f.p = b
j.w = a
j.t = n
j.z = n
b.q = a
b.z = a
b.y = n
b.o = f
b.t = l
g.z = n
g.s = f
g.p = f
g.x = f
a.q = f
a.s = l
a.w = g
a.t = j
l.u = j
e.q = a
e.z = a
e.y = n
e.o = f
e.t = l
assert g.p.p.o.txt == "f"