class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.p: E = None
        self.o: C = None
        self.v: G = None
        self.u: E = None
        self.s: C = None
        self.t: C = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: F = None
        self.r: D = None
        self.txt = txt

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

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

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

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