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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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