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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: H = None
        self.q: F = None
        self.txt = txt

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

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

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

b = A("b")
j = B("j")
d = C("d")
k = D("k")
h = E("h")
c = F("c")
f = G("f")
i = H("i")
e = H("e")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: H = None
        self.q: F = None
        self.txt = txt

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

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

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

b = A("b")
j = B("j")
d = C("d")
k = D("k")
h = E("h")
c = F("c")
f = G("f")
i = H("i")
e = H("e")

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