class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: G = None
        self.z: G = None
        self.o: G = None
        self.y: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.u: F = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

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