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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: A = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: G = None
        self.s: C = None
        self.r: D = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: B = None
        self.t: B = None
        self.z: G = None
        self.q: A = None
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

f = A("f")
i = B("i")
m = C("m")
j = D("j")
n = E("n")
a = F("a")
l = G("l")
b = E("b")
c = D("c")
h = D("h")

f.y = i
f.x = n
i.o = m
i.w = m
i.q = f
i.u = h
m.t = i
m.y = c
j.x = n
j.u = l
j.s = m
j.r = h
j.y = f
n.q = m
a.u = l
a.z = l
a.o = i
a.t = i
a.s = i
a.q = f
a.x = n
l.q = f
l.z = f
b.q = m
c.x = b
c.u = l
c.s = m
c.r = j
c.y = f
h.x = n
h.u = l
h.s = m
h.r = j
h.y = f
assert i.q.x.q.t.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.q: A = None
        self.u: D = None
        self.w: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: G = None
        self.s: C = None
        self.r: D = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.o: B = None
        self.t: B = None
        self.z: G = None
        self.q: A = None
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

f = A("f")
i = B("i")
m = C("m")
j = D("j")
n = E("n")
a = F("a")
l = G("l")
b = E("b")
c = D("c")
h = D("h")

f.y = i
f.x = n
i.o = m
i.w = m
i.q = f
i.u = h
m.t = i
m.y = c
j.x = n
j.u = l
j.s = m
j.r = h
j.y = f
n.q = m
a.u = l
a.z = l
a.o = i
a.t = i
a.s = i
a.q = f
a.x = n
l.q = f
l.z = f
b.q = m
c.x = b
c.u = l
c.s = m
c.r = j
c.y = f
h.x = n
h.u = l
h.s = m
h.r = j
h.y = f
assert i.q.x.q.t.q.y.txt == "i"