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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: G = None
        self.w: A = None
        self.p: D = None
        self.u: A = None
        self.y: F = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.v: B = None
        self.y: E = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

a = A("a")
k = B("k")
n = C("n")
g = D("g")
h = E("h")
d = F("d")
f = G("f")
e = C("e")

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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.r: G = None
        self.w: A = None
        self.p: D = None
        self.u: A = None
        self.y: F = None
        self.o: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.r: A = None
        self.v: B = None
        self.y: E = None
        self.o: B = None
        self.x: A = None
        self.txt = txt

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

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

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

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

a = A("a")
k = B("k")
n = C("n")
g = D("g")
h = E("h")
d = F("d")
f = G("f")
e = C("e")

a.w = k
k.t = f
k.r = f
k.w = a
k.u = a
k.p = g
k.y = d
k.o = h
n.u = f
n.r = a
n.x = a
n.v = k
n.o = k
n.y = h
g.v = k
g.z = f
h.x = f
h.u = d
h.z = g
d.o = g
d.v = k
d.s = a
d.p = n
d.y = h
f.t = d
e.u = f
e.r = a
e.x = a
e.v = k
e.o = k
e.y = h
assert n.v.o.z.z.t.txt == "d"