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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: F = None
        self.p: F = None
        self.w: F = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

i.q = g
i.t = n
i.x = c
l.o = j
l.z = g
l.p = g
l.w = g
l.q = b
c.y = b
c.s = j
j.q = b
j.z = b
j.o = n
b.u = g
g.q = j
n.y = i
n.w = c
m.o = j
m.z = g
m.p = g
m.w = g
m.q = b
a.q = g
a.t = n
a.x = c
assert l.w.q.o.y.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.t: G = None
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: F = None
        self.p: F = None
        self.w: F = None
        self.q: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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