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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: C = None
        self.u: F = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.v: C = None
        self.q: B = None
        self.s: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: H = None
        self.u: H = None
        self.r: B = None
        self.p: B = None
        self.txt = txt

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

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

k.x = a
k.p = l
f.y = n
f.o = j
f.u = l
f.t = d
j.x = i
j.v = n
n.o = j
n.r = j
n.v = j
n.q = f
n.s = d
i.w = k
l.p = n
l.y = i
d.w = l
d.y = a
d.u = a
d.r = f
d.p = f
a.v = j
assert a.v.x.w.p.y.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.p: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: C = None
        self.u: F = None
        self.t: G = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.v: C = None
        self.q: B = None
        self.s: G = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.y: H = None
        self.u: H = None
        self.r: B = None
        self.p: B = None
        self.txt = txt

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

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

k.x = a
k.p = l
f.y = n
f.o = j
f.u = l
f.t = d
j.x = i
j.v = n
n.o = j
n.r = j
n.v = j
n.q = f
n.s = d
i.w = k
l.p = n
l.y = i
d.w = l
d.y = a
d.u = a
d.r = f
d.p = f
a.v = j
assert a.v.x.w.p.y.txt == "i"