class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.w: D = None
        self.o: H = None
        self.y: E = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: H = None
        self.v: E = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.x: B = None
        self.v: C = None
        self.o: D = None
        self.w: H = None
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: G = None
        self.w: A = None
        self.u: F = None
        self.txt = txt

a = A("a")
e = B("e")
k = C("k")
m = D("m")
d = E("d")
c = F("c")
g = G("g")
i = H("i")

a.v = e
a.u = d
a.y = d
a.z = d
a.w = m
a.o = i
e.q = g
e.z = a
k.w = c
k.p = i
k.u = i
k.v = d
m.x = e
d.y = m
c.y = m
c.s = m
c.o = m
c.x = e
c.v = k
c.w = i
c.t = d
g.p = c
i.q = d
i.o = g
i.w = a
i.u = c
assert a.v.z.o.w.v.q.txt == "
class A:
    def __init__(self, txt: str):
        self.v: B = None
        self.u: E = None
        self.w: D = None
        self.o: H = None
        self.y: E = None
        self.z: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.p: H = None
        self.v: E = None
        self.u: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: D = None
        self.x: B = None
        self.v: C = None
        self.o: D = None
        self.w: H = None
        self.t: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: E = None
        self.o: G = None
        self.w: A = None
        self.u: F = None
        self.txt = txt

a = A("a")
e = B("e")
k = C("k")
m = D("m")
d = E("d")
c = F("c")
g = G("g")
i = H("i")

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