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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: D = None
        self.o: F = None
        self.r: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: H = None
        self.p: F = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = 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.t: D = None
        self.w: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: A = None
        self.x: D = None
        self.o: F = None
        self.r: A = None
        self.q: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: H = None
        self.t: G = None
        self.z: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: H = None
        self.p: F = None
        self.x: E = None
        self.z: E = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.y: C = 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.t: D = None
        self.w: G = None
        self.txt = txt

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

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