class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.z: G = None
        self.s: B = None
        self.y: A = None
        self.w: B = None
        self.v: B = None
        self.r: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.o: H = None
        self.x: C = None
        self.r: G = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: E = None
        self.s: D = None
        self.o: H = None
        self.x: C = None
        self.r: G = None
        self.u: A = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: G = None
        self.txt = txt

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

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