class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: D = None
        self.q: G = None
        self.t: C = None
        self.z: E = None
        self.r: H = None
        self.p: H = None
        self.o: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.w: B = None
        self.v: A = None
        self.s: H = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: B = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.w: B = None
        self.v: A = None
        self.s: H = None
        self.r: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: G = None
        self.x: B = None
        self.v: B = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.txt = txt

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

a.w = n
a.x = j
a.o = j
a.q = k
a.t = d
a.z = g
a.r = l
a.p = l
n.v = k
n.p = k
n.q = j
d.t = a
d.v = a
d.u = g
d.w = n
d.s = l
d.r = j
j.q = n
g.p = k
g.x = n
g.v = n
b.p = a
b.r = f
f.q = a
f.w = a
f.p = k
l.q = k
k.q = a
k.w = a
k.p = f
assert g.x.v.q.q.p.q.p.q.q.txt == "a"