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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.p: D = None
        self.txt = txt

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

j.t = d
j.s = f
j.q = f
j.w = l
j.r = k
j.y = n
j.v = h
c.s = k
c.t = j
c.q = l
c.x = n
n.q = j
a.q = n
k.x = h
k.w = c
k.s = l
h.z = j
h.v = d
h.p = d
h.r = n
l.v = f
l.w = h
d.o = j
d.r = j
d.p = a
f.q = n
assert l.w.v.p.q.q.w.w.txt == "
class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: D = None
        self.q: D = None
        self.w: G = None
        self.r: E = None
        self.y: C = None
        self.v: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: H = None
        self.p: H = None
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: A = None
        self.r: A = None
        self.p: D = None
        self.txt = txt

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

j.t = d
j.s = f
j.q = f
j.w = l
j.r = k
j.y = n
j.v = h
c.s = k
c.t = j
c.q = l
c.x = n
n.q = j
a.q = n
k.x = h
k.w = c
k.s = l
h.z = j
h.v = d
h.p = d
h.r = n
l.v = f
l.w = h
d.o = j
d.r = j
d.p = a
f.q = n
assert l.w.v.p.q.q.w.w.txt == "h"