class A:
    def __init__(self, txt: str):
        self.r: B = None
        self.w: H = None
        self.q: B = None
        self.y: C = None
        self.s: F = None
        self.x: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: A = None
        self.w: B = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: C = None
        self.x: A = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.r: A = None
        self.w: B = None
        self.u: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: H = None
        self.o: C = None
        self.x: A = None
        self.y: E = None
        self.p: B = None
        self.txt = txt

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

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

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