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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: H = None
        self.p: B = None
        self.z: A = None
        self.t: G = None
        self.s: D = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.v: G = None
        self.x: D = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: A = None
        self.p: F = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: D = None
        self.v: A = None
        self.txt = txt

b = A("b")
l = B("l")
h = C("h")
f = D("f")
i = E("i")
m = F("m")
j = G("j")
g = H("g")

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: H = None
        self.p: B = None
        self.z: A = None
        self.t: G = None
        self.s: D = None
        self.q: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: C = None
        self.v: G = None
        self.x: D = None
        self.s: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.t: H = None
        self.w: A = None
        self.p: F = None
        self.x: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: G = None
        self.p: D = None
        self.v: A = None
        self.txt = txt

b = A("b")
l = B("l")
h = C("h")
f = D("f")
i = E("i")
m = F("m")
j = G("j")
g = H("g")

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