class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.s: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: B = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: B = None
        self.y: G = None
        self.txt = txt

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

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

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

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