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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: D = None
        self.t: E = None
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.s: B = None
        self.t: A = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.u: C = None
        self.p: D = None
        self.w: F = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: B = None
        self.v: D = None
        self.t: E = None
        self.w: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: A = None
        self.q: D = None
        self.s: B = None
        self.t: A = None
        self.v: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: G = None
        self.r: G = None
        self.u: C = None
        self.p: D = None
        self.w: F = None
        self.t: F = None
        self.y: D = None
        self.txt = txt

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

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