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

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: D = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
g = C("g")
b = D("b")
f = E("f")
e = F("e")
a = G("a")
n = H("n")

l.x = e
k.o = a
k.s = b
k.y = l
k.u = f
g.w = e
b.p = k
b.v = f
f.v = a
e.u = f
e.x = g
e.r = k
e.z = l
a.x = g
a.v = e
a.t = k
a.u = k
n.p = k
n.t = e
assert k.o.v.r.y.x.r.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.s: D = None
        self.y: A = None
        self.u: E = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.txt = txt

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

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

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

l = A("l")
k = B("k")
g = C("g")
b = D("b")
f = E("f")
e = F("e")
a = G("a")
n = H("n")

l.x = e
k.o = a
k.s = b
k.y = l
k.u = f
g.w = e
b.p = k
b.v = f
f.v = a
e.u = f
e.x = g
e.r = k
e.z = l
a.x = g
a.v = e
a.t = k
a.u = k
n.p = k
n.t = e
assert k.o.v.r.y.x.r.y.txt == "l"