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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.r: E = None
        self.o: A = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: D = None
        self.u: E = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: A = None
        self.r: E = None
        self.o: C = None
        self.p: B = None
        self.y: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: D = None
        self.r: E = None
        self.o: A = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: D = None
        self.u: E = None
        self.q: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: D = None
        self.q: A = None
        self.r: E = None
        self.o: C = None
        self.p: B = None
        self.y: A = None
        self.txt = txt

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

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