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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.y: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

k.r = d
k.v = f
a.o = k
a.x = i
f.w = l
d.v = e
d.t = i
d.r = i
l.s = c
l.y = c
l.w = d
c.r = e
c.o = f
c.z = l
c.q = i
i.w = k
e.y = a
assert k.r.v.y.o.r.v.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.v: C = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.w: D = None
        self.y: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

k.r = d
k.v = f
a.o = k
a.x = i
f.w = l
d.v = e
d.t = i
d.r = i
l.s = c
l.y = c
l.w = d
c.r = e
c.o = f
c.z = l
c.q = i
i.w = k
e.y = a
assert k.r.v.y.o.r.v.y.x.txt == "i"