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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: E = None
        self.u: C = None
        self.o: E = None
        self.t: G = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: G = None
        self.q: C = None
        self.u: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: E = None
        self.u: C = None
        self.o: E = None
        self.t: G = None
        self.p: G = None
        self.w: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: F = None
        self.w: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.r: G = None
        self.q: C = None
        self.u: G = None
        self.txt = txt

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

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

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