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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

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

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

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

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