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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.t: G = None
        self.s: E = None
        self.txt = txt

j = A("j")
d = B("d")
i = C("i")
h = D("h")
g = E("g")
c = F("c")
f = G("f")
k = H("k")

j.y = d
d.x = j
i.x = c
i.p = k
i.t = j
i.o = g
h.z = d
h.t = d
h.r = d
h.v = k
g.x = c
g.u = j
c.u = i
c.x = f
c.p = d
f.z = j
f.v = j
f.s = c
f.x = g
k.w = g
k.s = g
k.v = j
k.t = f
assert c.u.x.x.z.y.x.txt == "
class A:
    def __init__(self, txt: str):
        self.y: B = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: G = None
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.z: A = None
        self.v: A = None
        self.s: F = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: A = None
        self.t: G = None
        self.s: E = None
        self.txt = txt

j = A("j")
d = B("d")
i = C("i")
h = D("h")
g = E("g")
c = F("c")
f = G("f")
k = H("k")

j.y = d
d.x = j
i.x = c
i.p = k
i.t = j
i.o = g
h.z = d
h.t = d
h.r = d
h.v = k
g.x = c
g.u = j
c.u = i
c.x = f
c.p = d
f.z = j
f.v = j
f.s = c
f.x = g
k.w = g
k.s = g
k.v = j
k.t = f
assert c.u.x.x.z.y.x.txt == "j"