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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: G = None
        self.w: D = None
        self.z: C = None
        self.y: H = None
        self.v: H = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = 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: D = None
        self.v: F = None
        self.w: F = None
        self.u: G = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: G = None
        self.w: D = None
        self.z: C = None
        self.y: H = None
        self.v: H = None
        self.p: G = None
        self.x: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: H = 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: D = None
        self.v: F = None
        self.w: F = None
        self.u: G = None
        self.txt = txt

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

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

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

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