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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.o: B = None
        self.z: C = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.y: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.x: A = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.u: B = None
        self.o: B = None
        self.z: C = None
        self.y: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.s: C = None
        self.v: B = None
        self.y: G = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: E = None
        self.y: F = None
        self.x: A = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: B = None
        self.z: E = None
        self.q: E = None
        self.txt = txt

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

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

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