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

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

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

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

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

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

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

m = A("m")
e = B("e")
i = C("i")
a = D("a")
h = E("h")
g = F("g")
j = G("j")

m.z = i
m.w = i
m.o = e
m.v = a
m.y = h
e.p = a
e.u = j
i.q = e
i.v = a
i.p = a
i.y = m
i.r = h
a.v = h
a.q = g
h.z = j
g.x = a
g.z = e
g.o = j
j.z = h
j.v = g
j.t = e
j.p = e
j.u = e
j.r = i
assert a.q.x.v.txt == "
class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.o: B = None
        self.v: D = None
        self.w: C = None
        self.y: E = None
        self.txt = txt

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

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

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

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

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

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

m = A("m")
e = B("e")
i = C("i")
a = D("a")
h = E("h")
g = F("g")
j = G("j")

m.z = i
m.w = i
m.o = e
m.v = a
m.y = h
e.p = a
e.u = j
i.q = e
i.v = a
i.p = a
i.y = m
i.r = h
a.v = h
a.q = g
h.z = j
g.x = a
g.z = e
g.o = j
j.z = h
j.v = g
j.t = e
j.p = e
j.u = e
j.r = i
assert a.q.x.v.txt == "h"