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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.v: F = None
        self.u: G = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.w: C = None
        self.z: D = None
        self.t: A = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: F = None
        self.p: C = None
        self.v: F = None
        self.u: G = None
        self.o: G = None
        self.z: D = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.q: E = None
        self.w: C = None
        self.z: D = None
        self.t: A = None
        self.v: F = None
        self.r: B = None
        self.txt = txt

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

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