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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.o: F = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

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

d.o = c
d.x = a
c.t = f
c.q = f
c.o = a
c.z = d
f.z = h
i.z = a
i.o = m
j.z = i
j.s = f
a.z = c
a.s = m
a.x = n
h.q = i
h.z = f
m.v = d
m.z = d
m.u = i
l.z = i
l.s = f
n.z = i
n.s = f
assert f.z.q.o.v.x.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.o: B = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.q: C = None
        self.o: F = None
        self.z: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.s: C = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.u: D = None
        self.z: A = None
        self.txt = txt

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

d.o = c
d.x = a
c.t = f
c.q = f
c.o = a
c.z = d
f.z = h
i.z = a
i.o = m
j.z = i
j.s = f
a.z = c
a.s = m
a.x = n
h.q = i
h.z = f
m.v = d
m.z = d
m.u = i
l.z = i
l.s = f
n.z = i
n.s = f
assert f.z.q.o.v.x.x.z.txt == "i"