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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.z: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

j.q = f
e.z = a
e.p = a
e.w = a
e.t = i
e.y = f
e.o = f
e.s = c
n.s = g
n.p = e
n.w = e
n.z = i
a.s = c
a.y = e
f.q = e
f.r = i
i.o = j
i.w = j
i.z = j
i.p = f
i.r = e
k.x = i
g.x = i
b.s = n
b.y = e
c.s = k
c.p = e
c.w = e
c.z = i
assert n.w.p.y.w.s.p.s.z.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: B = None
        self.z: F = None
        self.w: B = None
        self.txt = txt

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

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

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

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

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

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