class A:
    def __init__(self, txt: str):
        self.w: D = None
        self.t: F = None
        self.y: C = None
        self.r: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.o: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: H = None
        self.txt = txt

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

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

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

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