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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: E = None
        self.w: A = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: E = None
        self.w: A = None
        self.p: A = None
        self.s: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.t: B = None
        self.txt = txt

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

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

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

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