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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.u: B = None
        self.r: F = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: E = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
l = C("l")
k = D("k")
a = E("a")
f = F("f")
i = B("i")
d = B("d")

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

class B:
    def __init__(self, txt: str):
        self.z: E = None
        self.s: C = None
        self.u: B = None
        self.r: F = None
        self.y: B = None
        self.q: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: A = None
        self.x: E = None
        self.txt = txt

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

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

g = A("g")
e = B("e")
l = C("l")
k = D("k")
a = E("a")
f = F("f")
i = B("i")
d = B("d")

g.w = f
e.z = a
e.s = l
e.u = d
e.r = f
e.y = i
e.q = k
l.u = a
l.v = e
l.z = d
k.o = g
k.x = a
a.o = f
a.q = f
a.w = k
a.y = k
a.z = g
a.v = g
f.q = e
i.z = a
i.s = l
i.u = e
i.y = e
i.r = f
i.q = k
d.z = a
d.s = l
d.u = e
d.r = f
d.y = i
d.q = k
assert g.w.q.z.v.w.q.r.q.txt == "e"