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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: D = None
        self.p: C = None
        self.u: A = None
        self.w: E = None
        self.x: E = None
        self.o: A = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: B = None
        self.x: F = None
        self.t: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.s: E = None
        self.z: D = None
        self.p: C = None
        self.u: A = None
        self.w: E = None
        self.x: E = None
        self.o: A = None
        self.txt = txt

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

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