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

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: F = None
        self.o: G = None
        self.t: A = None
        self.v: A = None
        self.w: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

e = A("e")
h = B("h")
b = C("b")
g = D("g")
j = E("j")
d = F("d")
k = G("k")
n = A("n")

e.q = n
e.p = b
h.u = k
h.s = k
b.p = g
b.r = h
b.s = j
g.q = k
g.o = k
g.y = d
g.t = n
g.v = n
g.z = n
g.w = j
j.r = d
j.v = h
j.p = n
d.w = k
k.q = g
k.p = b
k.t = n
k.o = j
k.u = h
n.q = e
n.p = b
assert j.r.w.o.p.q.q.q.txt == "
class A:
    def __init__(self, txt: str):
        self.q: A = None
        self.p: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: G = None
        self.s: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: F = None
        self.o: G = None
        self.t: A = None
        self.v: A = None
        self.w: E = None
        self.z: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: B = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.w: G = None
        self.txt = txt

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

e = A("e")
h = B("h")
b = C("b")
g = D("g")
j = E("j")
d = F("d")
k = G("k")
n = A("n")

e.q = n
e.p = b
h.u = k
h.s = k
b.p = g
b.r = h
b.s = j
g.q = k
g.o = k
g.y = d
g.t = n
g.v = n
g.z = n
g.w = j
j.r = d
j.v = h
j.p = n
d.w = k
k.q = g
k.p = b
k.t = n
k.o = j
k.u = h
n.q = e
n.p = b
assert j.r.w.o.p.q.q.q.txt == "e"