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

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.s: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: G = None
        self.r: F = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.y: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

g = A("g")
a = B("a")
b = C("b")
j = D("j")
c = E("c")
h = F("h")
l = G("l")
i = H("i")
d = H("d")

g.x = j
g.w = j
g.q = b
a.t = l
a.z = d
a.s = b
a.v = g
b.s = h
b.r = h
b.u = l
b.w = j
b.t = j
j.t = c
j.x = a
j.y = l
j.u = l
c.t = l
c.u = l
h.q = d
h.o = a
l.q = j
l.y = h
i.z = j
i.y = a
i.q = g
i.u = d
i.w = b
i.x = h
i.r = l
i.p = c
d.z = j
d.y = a
d.q = g
d.u = i
d.w = b
d.x = h
d.r = l
d.p = c
assert j.t.t.q.t.u.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.q: C = None
        self.w: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: G = None
        self.z: H = None
        self.s: C = None
        self.v: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.u: G = None
        self.r: F = None
        self.w: D = None
        self.t: D = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: E = None
        self.x: B = None
        self.y: G = None
        self.u: G = None
        self.txt = txt

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

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

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

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

g = A("g")
a = B("a")
b = C("b")
j = D("j")
c = E("c")
h = F("h")
l = G("l")
i = H("i")
d = H("d")

g.x = j
g.w = j
g.q = b
a.t = l
a.z = d
a.s = b
a.v = g
b.s = h
b.r = h
b.u = l
b.w = j
b.t = j
j.t = c
j.x = a
j.y = l
j.u = l
c.t = l
c.u = l
h.q = d
h.o = a
l.q = j
l.y = h
i.z = j
i.y = a
i.q = g
i.u = d
i.w = b
i.x = h
i.r = l
i.p = c
d.z = j
d.y = a
d.q = g
d.u = i
d.w = b
d.x = h
d.r = l
d.p = c
assert j.t.t.q.t.u.q.txt == "j"