class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: H = None
        self.u: F = None
        self.v: F = None
        self.o: C = None
        self.p: H = None
        self.t: D = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.x: H = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.z: B = None
        self.q: E = None
        self.w: B = None
        self.s: B = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: C = None
        self.x: A = None
        self.v: A = None
        self.p: F = None
        self.txt = txt

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

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

i.y = j
i.s = d
i.p = d
i.u = k
i.v = k
i.o = n
i.t = c
i.w = e
j.r = g
j.w = g
j.q = n
j.x = d
n.q = d
n.y = d
c.u = k
c.v = k
c.x = n
c.z = j
c.w = j
c.s = j
c.r = j
c.q = g
g.v = e
k.q = i
e.u = d
e.q = n
e.x = i
e.v = i
e.p = k
d.y = e
d.s = e
assert n.y.y.p.q.y.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: H = None
        self.u: F = None
        self.v: F = None
        self.o: C = None
        self.p: H = None
        self.t: D = None
        self.w: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.x: H = None
        self.w: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.u: F = None
        self.x: C = None
        self.z: B = None
        self.q: E = None
        self.w: B = None
        self.s: B = None
        self.r: B = None
        self.v: F = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.u: H = None
        self.q: C = None
        self.x: A = None
        self.v: A = None
        self.p: F = None
        self.txt = txt

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

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

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