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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.o: A = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: B = None
        self.p: A = None
        self.s: A = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: H = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: F = None
        self.s: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.v: D = None
        self.q: D = None
        self.o: A = None
        self.r: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: B = None
        self.p: A = None
        self.s: A = None
        self.q: G = None
        self.r: F = None
        self.txt = txt

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

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