class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: F = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: H = None
        self.y: F = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

c = A("c")
n = B("n")
g = C("g")
k = D("k")
e = E("e")
j = F("j")
a = G("a")
f = H("f")

c.t = f
c.y = j
c.u = j
c.q = a
n.p = f
n.w = k
n.s = c
g.r = f
g.t = c
g.s = c
k.s = n
e.r = g
e.t = g
e.o = f
e.y = j
e.z = n
j.z = c
j.w = n
a.s = g
a.w = g
a.t = c
a.o = k
f.q = k
f.s = g
f.p = e
assert j.w.w.s.p.q.s.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.y: F = None
        self.u: F = None
        self.q: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: D = None
        self.s: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.t: A = None
        self.s: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: H = None
        self.y: F = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.t: A = None
        self.o: D = None
        self.w: C = None
        self.txt = txt

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

c = A("c")
n = B("n")
g = C("g")
k = D("k")
e = E("e")
j = F("j")
a = G("a")
f = H("f")

c.t = f
c.y = j
c.u = j
c.q = a
n.p = f
n.w = k
n.s = c
g.r = f
g.t = c
g.s = c
k.s = n
e.r = g
e.t = g
e.o = f
e.y = j
e.z = n
j.z = c
j.w = n
a.s = g
a.w = g
a.t = c
a.o = k
f.q = k
f.s = g
f.p = e
assert j.w.w.s.p.q.s.txt == "n"