class A:
    def __init__(self, txt: str):
        self.w: C = None
        self.p: C = None
        self.x: B = None
        self.q: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.q: E = None
        self.x: A = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: E = None
        self.y: C = None
        self.q: E = None
        self.x: A = None
        self.p: E = None
        self.s: F = None
        self.txt = txt

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

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

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

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

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