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

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.o: A = None
        self.y: F = None
        self.x: F = None
        self.w: G = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.q: C = None
        self.x: B = None
        self.t: A = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: A = None
        self.x: B = None
        self.u: D = None
        self.s: D = None
        self.t: F = None
        self.txt = txt

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

g.w = l
g.o = j
g.p = j
g.t = f
l.s = a
l.p = a
l.v = d
l.w = d
l.o = g
l.y = k
l.x = k
j.o = f
j.q = f
j.z = a
a.w = l
a.u = j
a.z = j
f.u = a
f.v = a
f.q = j
f.x = l
f.t = g
f.o = k
k.z = a
k.x = d
d.q = j
d.v = g
d.x = l
d.u = a
d.s = a
d.t = k
assert g.w.x.z.u.z.z.q.txt == "
class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: C = None
        self.p: C = None
        self.t: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: G = None
        self.o: A = None
        self.y: F = None
        self.x: F = None
        self.w: G = None
        self.p: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.q: E = None
        self.z: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: D = None
        self.v: D = None
        self.q: C = None
        self.x: B = None
        self.t: A = None
        self.o: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.v: A = None
        self.x: B = None
        self.u: D = None
        self.s: D = None
        self.t: F = None
        self.txt = txt

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

g.w = l
g.o = j
g.p = j
g.t = f
l.s = a
l.p = a
l.v = d
l.w = d
l.o = g
l.y = k
l.x = k
j.o = f
j.q = f
j.z = a
a.w = l
a.u = j
a.z = j
f.u = a
f.v = a
f.q = j
f.x = l
f.t = g
f.o = k
k.z = a
k.x = d
d.q = j
d.v = g
d.x = l
d.u = a
d.s = a
d.t = k
assert g.w.x.z.u.z.z.q.txt == "f"