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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.x: A = None
        self.y: A = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: B = None
        self.x: F = None
        self.s: D = None
        self.p: H = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: H = None
        self.t: C = None
        self.u: E = None
        self.v: C = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: A = None
        self.o: D = None
        self.t: G = None
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.t: E = None
        self.x: A = None
        self.y: A = None
        self.w: H = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.z: H = None
        self.t: B = None
        self.x: F = None
        self.s: D = None
        self.p: H = None
        self.w: A = None
        self.y: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.z: G = None
        self.o: H = None
        self.t: C = None
        self.u: E = None
        self.v: C = None
        self.r: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: A = None
        self.o: D = None
        self.t: G = None
        self.z: C = None
        self.txt = txt

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

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