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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.s: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.u: B = None
        self.x: A = None
        self.s: D = None
        self.txt = txt

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

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

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

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

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