class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: C = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

c = A("c")
i = B("i")
k = C("k")
h = D("h")
j = E("j")
d = F("d")
e = G("e")

c.v = j
i.u = c
i.y = c
i.s = h
i.p = k
i.v = j
k.x = e
k.z = j
h.z = c
h.w = e
h.y = i
h.p = d
j.o = d
j.z = d
j.y = d
j.p = i
j.t = i
j.q = k
j.v = h
d.r = i
d.z = k
d.t = h
d.o = j
e.w = c
e.q = j
e.x = j
e.v = j
e.y = h
assert e.q.z.r.y.v.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.z: C = None
        self.t: D = None
        self.o: E = None
        self.txt = txt

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

c = A("c")
i = B("i")
k = C("k")
h = D("h")
j = E("j")
d = F("d")
e = G("e")

c.v = j
i.u = c
i.y = c
i.s = h
i.p = k
i.v = j
k.x = e
k.z = j
h.z = c
h.w = e
h.y = i
h.p = d
j.o = d
j.z = d
j.y = d
j.p = i
j.t = i
j.q = k
j.v = h
d.r = i
d.z = k
d.t = h
d.o = j
e.w = c
e.q = j
e.x = j
e.v = j
e.y = h
assert e.q.z.r.y.v.q.x.txt == "e"