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

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

l.r = d
l.q = i
l.x = m
m.o = i
k.x = g
k.v = g
k.r = m
k.s = n
h.u = k
h.y = b
h.w = d
i.p = k
i.x = b
n.u = g
n.w = k
n.o = d
g.p = b
g.t = l
d.u = i
b.u = k
b.y = h
b.w = d
assert d.u.p.v.t.x.o.txt == "
class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.q: E = None
        self.x: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

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

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