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

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

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

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

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

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

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

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

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

a.u = l
i.v = g
e.u = g
e.r = i
e.t = f
e.z = a
f.o = l
f.u = a
g.y = a
g.o = j
l.y = f
l.q = e
j.r = g
k.v = j
assert j.r.y.u.y.o.y.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

a.u = l
i.v = g
e.u = g
e.r = i
e.t = f
e.z = a
f.o = l
f.u = a
g.y = a
g.o = j
l.y = f
l.q = e
j.r = g
k.v = j
assert j.r.y.u.y.o.y.u.u.txt == "l"