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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: G = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: C = None
        self.txt = txt

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

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

m = A("m")
d = B("d")
a = C("a")
j = D("j")
c = E("c")
h = F("h")
n = G("n")

m.z = j
m.u = d
d.q = n
d.p = n
d.v = h
d.x = c
d.t = a
a.o = h
a.v = n
a.t = n
a.y = c
j.o = d
c.y = h
c.t = a
h.p = j
h.v = d
n.r = c
n.t = m
assert j.o.v.v.x.txt == "
class A:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.v: G = None
        self.y: E = None
        self.t: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: C = None
        self.txt = txt

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

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

m = A("m")
d = B("d")
a = C("a")
j = D("j")
c = E("c")
h = F("h")
n = G("n")

m.z = j
m.u = d
d.q = n
d.p = n
d.v = h
d.x = c
d.t = a
a.o = h
a.v = n
a.t = n
a.y = c
j.o = d
c.y = h
c.t = a
h.p = j
h.v = d
n.r = c
n.t = m
assert j.o.v.v.x.txt == "c"